import 'dart:convert';

import 'package:flutter_provider_demo/commons/log.dart';

class SecurityUtils {
  static String? base64Decode(String text) {
    int paddingNeeded = (4 - text.length % 4) % 4;
    text += '=' * paddingNeeded;

    try {
      return String.fromCharCodes(base64Url.decode(text));
    } on Exception catch (e) {
      Log().warn("base64 decode error", e);
      return null;
    }
  }
}
